new Vue({
    el:'#app',
    data:{
        Case_law:{
            caseId:'',
            clientId:{
                clientId:''
            },
            oppositeId:{
                clientId:''
            },
            caseTypeid:{
                caseTypeid:''
            },
            thirdParty:'',
            objectOfAction:'',
            locusStandi:'',
            agencyMoney:'',
            blendMoney:'',
            courtId:{
                courtId:''
            },
            stateSessionDate:'',
            sessionDate:'',
            causeOfAction:'',
            causeDetails:'',
            mainLawyer:{
                empId:''
            },
            version:'',
            comment:'',
            submitId:{
                userId:''
            }
        },
        Case_audit:{
            remissionMoney:'',
            auditid:{
                auditid:'',
                auditUserid:{
                    userId:''
                },
                comment:'',
                if_pass:''
            },
            caseid:{
                caseId:'' 
            }
        }
    },
    created(){
      this.init();  
    },
    methods:{
        init(){
            var processid = getUrlParam("processid");
            this.Case_audit.auditid.auditid = processid;
            this.$http.post("http://localhost:8080/remission/queryCaseAndRemissionByProcessid",
                {"processid":processid},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")");
                this.Case_law = msg.data.caseid; 
                this.Case_audit.remissionMoney = msg.data.remissionMoney;
            });
        },
        onSubmit(){ //完成费用减免审核
           this.Case_audit.auditid.auditUserid.userId = $.cookie("redisId");
           this.Case_audit.caseid.caseId = this.Case_law.caseId;
           var data = JSON.stringify(this.Case_audit);
           this.$http.post("http://localhost:8080/remission/complateByremission",
               {"data":data},{emulateJSON: true}).then(result=>{
               var msg = eval("("+result.body+")")
               alert(msg.data);
               //办理完成返回到显示页面去
               window.location.href="MyTasks.html";
           });
           
        }
    }
});